<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateEarningsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('earnings', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('关联下载用户ID');
            $table->integer('type')->comment('type分类');
            $table->integer('money')->comment('收益金额');
            $table->integer('data_id')->comment('关联模型ID');
            $table->integer('coins')->comment('花费交易币');
            $table->integer('earning_user_id')->comment('收益用户');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('earnings');
    }
}
